Coalescing properties, methods and events

ABSTRACT

Coalescing properties, methods and events is disclosed. One embodiment of the invention is a computerized system having an ActiveX control, a Java object, and an engine. The engine, which may be a computer program running on a computer, converts types of the ActiveX control to corresponding types of the Java object. In different embodiments of the invention, the engine may be compile-time or run-time.

FIELD

[0001] This invention relates generally to properties, methods and events available in software component architectures, and more particularly to coalescing such properties, methods and events between different such architectures.

BACKGROUND

[0002] Software component architectures have become an increasingly popular manner by which developers develop computer programs. Software components may be reusable, such that developers do not have to rewrite code to provide for functionality that is already provided by a given software component. Common software component architectures include those available within the Java programming language, such as JavaBeans and other Java objects, as well as Microsoft's Component Object Model (COM).

[0003] A software component typically has outside interfaces that allow interconnection with other software components, and inside code that effectuates or implements these interfaces. The inside code is not usually accessible to other components. The outside interfaces may come in three different types: properties, methods and events. The occurrence of an event, which may be generally defined as a condition, causes the execution of a method. A method, which has one or more properties that may be generally defined as parameters of the method, may be generally defined as a sequence of code that provides for a desired functionality.

[0004] A disadvantage to software developers is, however, that software components written in accordance with one architecture, such as COM, may not usually be used in accordance with another, such as Java. This means that even if the developer finds a component that he or she desires to use, if the component is operative within a different architecture, the component is generally unusable. For these and other reasons, there is a need for the present invention.

SUMMARY

[0005] The above-mentioned shortcomings, disadvantages and problems are addressed by the present invention, which will be understood by reading and studying the following specification. One aspect of the invention is a computerized system having an ActiveX control, a Java object, and an engine. The engine, which may be a computer program running on a computer, converts types of the ActiveX control to corresponding types of the Java object. In different embodiments of the invention, the engine may be compile-time or run-time.

[0006] At least some embodiments of the invention provides for advantages over the prior art. For example, ActiveX controls, which are a type of object within the Component Object Model (COM), may be utilized within a Java environment via at least some embodiments of the invention. Thus, the Java programmer is not limited to utilizing only Java objects such as JavaBeans in developing programs, but may also resort to COM objects such as ActiveX controls. Such embodiments of the invention provide for such coalescing of types from ActiveX controls to Java at both compile-time and run-time.

[0007] The present invention includes computerized systems, computers, and computer-readable media of varying scope. In addition to the aspects and advantages of the present invention described in this summary, further aspects and advantages of the invention will become apparent by reference to the drawings and by reading the detailed description that follows.

BRIEF DESCRIPTION OF THE DRAWINGS

[0008]FIG. 1 shows a diagram of the hardware and operating environment in conjunction with which embodiments of the invention may be practiced;

[0009]FIG. 2 shows a block diagram of a system according to a compile-time embodiment of the invention;

[0010]FIG. 3 shows a flowchart of a method according to a compile-time embodiment of the invention;

[0011]FIG. 4 shows a block diagram of a system according to a run-time embodiment of the invention;

[0012]FIG. 5 shows a flowchart of a method according to a run-time embodiment of the invention; and,

[0013]FIG. 6 shows a flowchart of another method according to a run-time embodiment of the invention.

DETAILED DESCRIPTION

[0014] In the following detailed description of exemplary embodiments of the invention, reference is made to the accompanying drawings which form a part hereof, and in which is shown by way of illustration specific exemplary embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention, and it is to be understood that other embodiments may be utilized and that logical, mechanical, electrical and other changes may be made without departing from the spirit or scope of the present invention. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present invention is defined only by the appended claims.

[0015] The detailed description is divided into four sections. In the first section, the hardware and the operating environment in conjunction with which embodiments of the invention may be practiced are described. In the second section, a compile-time embodiment of the invention is presented. In the third section, a run-time embodiment of the invention of the invention is given. Finally, in the fourth section, a conclusion of the detailed description is provided.

Hardware and Operating Environment

[0016] Referring to FIG. 1, a diagram of the hardware and operating environment in conjunction with which embodiments of the invention may be practiced is shown. The description of FIG. 1 is intended to provide a brief, general description of suitable computer hardware and a suitable computing environment in conjunction with which the invention may be implemented. Although not required, the invention is described in the general context of computer-executable instructions, such as program modules, being executed by a computer, such as a personal computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform particular tasks or implement particular abstract data types.

[0017] Moreover, those skilled in the art will appreciate that the invention may be practiced with other computer system configurations, including hand-held devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, network PCS, minicomputers, mainframe computers, and the like. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote memory storage devices.

[0018] The exemplary hardware and operating environment of FIG. 1 for implementing the invention includes a general purpose computing device in the form of a computer 20, including a processing unit 21, a system memory 22, and a system bus 23 that operatively couples various system components include the system memory to the processing unit 21. There may be only one or there may be more than one processing unit 21, such that the processor of computer 20 comprises a single central-processing unit (CPU), or a plurality of processing units, commonly referred to as a parallel processing environment. The computer 20 may be a conventional computer, a distributed computer, or any other type of computer; the invention is not so limited.

[0019] The system bus 23 may be any of several types of bus structures including a memory bus or memory controller, a peripheral bus, and a local bus using any of a variety of bus architectures. The system memory may also be referred to as simply the memory, and includes read only memory (ROM) 24 and random access memory (RAM) 25. A basic input/output system (BIOS) 26, containing the basic routines that help to transfer information between elements within the computer 20, such as during start-up, is stored in ROM 24. The computer 20 further includes a hard disk drive 27 for reading from and writing to a hard disk, not shown, a magnetic disk drive 28 for reading from or writing to a removable magnetic disk 29, and an optical disk drive 30 for reading from or writing to a removable optical disk 31 such as a CD ROM or other optical media.

[0020] The hard disk drive 27, magnetic disk drive 28, and optical disk drive 30 are connected to the system bus 23 by a hard disk drive interface 32, a magnetic disk drive interface 33, and an optical disk drive interface 34, respectively. The drives and their associated computer-readable media provide nonvolatile storage of computer-readable instructions, data structures, program modules and other data for the computer 20. It should be appreciated by those skilled in the art that any type of computer-readable media which can store data that is accessible by a computer, such as magnetic cassettes, flash memory cards, digital video disks, Bernoulli cartridges, random access memories (RAMs), read only memories (ROMs), and the like, may be used in the exemplary operating environment.

[0021] A number of program modules may be stored on the hard disk, magnetic disk 29, optical disk 31, ROM 24, or RAM 25, including an operating system 35, one or more application programs 36, other program modules 37, and program data 38. A user may enter commands and information into the personal computer 20 through input devices such as a keyboard 40 and pointing device 42. Such pointing devices may include a mouse, a trackball, a wheel, a touch pad, etc.; the invention is not so limited. Other input devices (not shown) may include a microphone, joystick, game pad, satellite dish, scanner, or the like. These and other input devices are often connected to the processing unit 21 through a serial port interface 46 that is coupled to the system bus, but may be connected by other interfaces, such as a parallel port, game port, or a universal serial bus (USB). A monitor 47 or other type of display device is also connected to the system bus 23 via an interface, such as a video adapter 48. In addition to the monitor, computers typically include other peripheral output devices (not shown), such as speakers and printers.

[0022] The computer 20 may operate in a networked environment using logical connections to one or more remote computers, such as remote computer 49. These logical connections are achieved by a communication device coupled to or a part of the computer 20; the invention is not limited to a particular type of communications device. The remote computer 49 may be another computer, a server, a router, a network PC, a client, a peer device or other common network node, and typically includes many or all of the elements described above relative to the computer 20, although only a memory storage device 50 has been illustrated in FIG. 1. The logical connections depicted in FIG. 1 include a local-area network (LAN) 51 and a wide-area network (WAN) 52. Such networking environments are commonplace in office networks, enterprise-wide computer networks, intranets and the Internet, which are all types of networks.

[0023] When used in a LAN-networking environment, the computer 20 is connected to the local network 51 through a network interface or adapter 53, which is one type of communications device. When used in a WAN-networking environment, the computer 20 typically includes a modem 54, a type of communications device, or any other type of communications device for establishing communications over the wide area network 52, such as the Internet. The modem 54, which may be internal or external, is connected to the system bus 23 via the serial port interface 46. In a networked environment, program modules depicted relative to the personal computer 20, or portions thereof, may be stored in the remote memory storage device. It is appreciated that the network connections shown are exemplary and other means of and communications devices for establishing a communications link between the computers may be used.

[0024] The hardware and operating environment in conjunction with which embodiments of the invention may be practiced has been described. The computer in conjunction with which embodiments of the invention may be practiced may be a conventional computer, a distributed computer, or any other type of computer; the invention is not so limited. Such a computer typically includes one or more processing units as its processor, and a computer-readable medium such as a memory.

A Compile-Time Embodiment of the Invention

[0025] A description of a compile-time embodiment of the invention is described by reference to FIG. 2 and FIG. 3. Referring first to FIG. 2, a computerized system according to a compile-time embodiment of the invention is shown. The computerized system includes an engine 200, an ActiveX control 202, and a Java object 204. The engine 200 is desirably a computer program running on a computer (for example, a program executed by a processor of the computer from a computer-readable medium such as a memory of the computer); the invention is not so limited, however. The engine 200 converts at compile-time types of the ActiveX control 202 to corresponding types of the Java object 204.

[0026] The ActiveX control 202 is a Component Object Model (COM) object. The control 202 has a number of types, stored in a type library as known within the art. The types include events, methods and properties. The ActiveX control describes its type information in what is known in the art as type libraries. The Java object 204 is an object for use within a Java programming language environment. Representative such objects include JavaBeans, although the invention is not so limited. The Java object 204 also has a number of types, stored as a series of design patterns, as also known within the art.

[0027] Thus, the (compile-time) embodiment of the invention shown in FIG. 2 achieves type coalescing by converting the events, methods and properties of the ActiveX control 202 to corresponding events, methods and properties of the Java object 204. In this way, at least some embodiments of the invention have advantages over the prior art. For example, by utilizing the engine 200 of the compile-time embodiment of the invention shown in FIG. 2, a developer is able to utilizing ActiveX controls within a Java environment; that is, the properties, methods and events of an ActiveX object are exposed to the Java developer, such that they are seamlessly accessible from Java objects. The embodiment of FIG. 2 is compile-time in the sense that the engine 200 converts ActiveX control types to corresponding Java object types at the time of compiling Java objects, as opposed to at run-time.

[0028] Referring next to FIG. 3, a flowchart of a method according to a compile-time embodiment of the invention is shown. The embodiment of the invention of FIG. 3 may be utilized in conjunction with or in lieu of the embodiment of FIG. 2; that is, the embodiment of FIG. 3 does not require utilization of FIG. 2 as well. The method to be performed may be one or more computer programs (e.g., an engine program) made up of computer-executable instructions. Describing the method by reference to a flowchart enables one skilled in the art to develop programs including instructions to carry out the methods on a suitable computer (the processor of the computer executing the instructions from computer-readable media such as memory). The one or more computer programs may be stored on a computer-readable medium such as a floppy disk or a compact-disc read-only-memory (CD-ROM). An engine program in one embodiment thus converts types of an ActiveX control to corresponding types of a Java object at compile-time.

[0029] In 300, a type library of an ActiveX control is retrieved. The type library is then proceeded through to convert types of the ActiveX control to corresponding types of a Java object. The conversion is performed in one embodiment by a type-coalescing engine, which desirably has a look-up table to map ActiveX control types (that is, OLE Automation types, as known within the art) to Java types. Furthermore, desirably, only those types from the type library that have matches in the look-up table are converted. Desirably, conversion is performed at compile-time.

[0030] In 301, an interface is retrieved from the type library of the ActiveX control retrieved in 300. In 302, it is determined whether the interface is an event interface. Events are described in the type library as a dispinterface or an outgoing interface, as known within the art. If the interface is an event interface, control proceeds to 304. In 304, the event interface of the ActiveX type library is converted to a Java class. Next, in 306, a method for the event interface retrieved in 301 is retrieved. In 308, the method is converted to Java. If in 310 there are more methods, control proceeds back to 306; otherwise, control proceeds to 312, where it is checked whether there are more interfaces. If not, the method ends at 314; otherwise, control proceeds back to 301.

[0031] If, however, at 302 the interface is determined not to be an event interface, control proceeds to 316. In 316, the interface of the ActiveX type library is converted to a Java class. Unlike with event interfaces, other interfaces may have properties. Thus, in 318, a method for the interface retrieved in 316 is retrieved. The method may be marked in the type library as a property, as known within the art. A property in one embodiment may be defined as having a setFoo and/or a getFoo call, as known within the art. If this is the case, then from 320 to 322, the property name is manipulated to match an appropriate Java design pattern (i.e., the property is converted into Java). Furthermore, a look-up table of ID's is maintained, desirably, where the ID is used by the Java Virtual Machine to make a call into the ActiveX control (i.e., an OLE object) when the property needs to be invoked. If, however, the method does not have a property (or, all the properties have been processed), then from 320 to 324, the method is converted into Java. In either case, in 326, if there are more methods, then control proceeds back to 318. Otherwise, control proceeds to 312. If there are more events in the type library retrieved in 300, then control proceeds back to 301. Otherwise, the method of FIG. 3 ends at 314. A description of a compile-time embodiment of the invention has thus been provided in this section of the detailed description.

A Run-Time Embodiment of the Invention

[0032] In the previous section, a description of a compile-time embodiment of the invention was described. In this section, a description of a run-time embodiment of the invention is provided. A description of a run-time embodiment of the invention is described by reference to FIGS. 4, 5 and 6. Referring first to FIG. 4, a computerized system according to a compile-time embodiment of the invention is shown. The computerized system includes an engine 400, a property bag 404 of properties associated with an ActiveX control, and a Java stream 402 of properties associated with a Java object. The engine 400 is desirably a computer program running on a computer (for example, a program executed by a processor of the computer from a computer-readable medium such as a memory of the computer); the invention is not so limited, however. The engine 400 converts at run-time types (specifically, properties) of an ActiveX control associated with the property bag 404 to corresponding types (specifically, properties) of a Java object associated with the Java stream 402, and vice-versa.

[0033] The ActiveX control associated with the property bag 404 is a Component Object Model (COM) object. ActiveX controls, as known within the art, can have their state loaded from or saved to a property bag. A property bag is a stream of bits that can be located on a medium, such as a memory or a disk. The Java object associated with the Java stream 402 is an object for use within a Java programming language environment. Representative such objects include JavaBeans, although the invention is not so limited. A Java stream is also a stream of bits that can be located on a medium, such as a memory or a disk. Both a property bag in the case of COM and a Java stream in the case of Java provide for the persistence of properties of their associated objects.

[0034] Thus, the (run-time) embodiment of the invention shown in FIG. 4 achieves type coalescing by converting the properties of the property bag 404 to corresponding properties of the Java stream 402, and vice-versa. In this way, at least some embodiments of the invention have advantages over the prior art. For example, by utilizing the engine 400 of the run-time embodiment of the invention shown in FIG. 4, a developer is able to utilizing ActiveX controls within a Java environment at run-time; that is, the properties of an ActiveX object are exposed to the Java developer and remain persistent (i.e., persistence is achieved), such that they are seamlessly accessible from Java objects, and vice-versa. The embodiment of FIG. 4 is run-time in the sense that the engine 400 converts ActiveX control properties to corresponding Java object properties, and vice-versa, during execution of a computer program, at run-time, as opposed to at compile-time.

[0035] Referring next to FIG. 5, a flowchart of a method according to a run-time embodiment of the invention is shown. The embodiment of the invention of FIG. 5 may be utilized in conjunction with or in lieu of the embodiment of FIG. 4; that is, the embodiment of FIG. 5 does not require utilization of FIG. 4 as well. The method to be performed may be one or more computer programs made up of computer-executable instructions (e.g., an engine program). Describing the method by reference to a flowchart enables one skilled in the art to develop programs including instructions to carry out the methods on a suitable computer (the processor of the computer executing the instructions from computer-readable media such as memory). The one or more computer programs may be stored on a computer-readable medium such as a floppy disk or a compact-disc read-only-memory (CD-ROM). In one embodiment, an engine program converts types (specifically, properties) of an ActiveX control associated with a property bag to corresponding types (specifically, properties) of a Java object associated with a Java stream, and vice-versa, at run-time. The method of FIG. 5 specifically recites the conversion of Java properties to OLE properties, as the latter term is known within the art.

[0036] In 500, a Java stream is read from a medium such as a hard disk drive or a memory. Desirably, the stream is read by an engine program. In 502, a property bag corresponding to the Java stream is dynamically created if necessary (that is, if one does not already exist), desirably as an in-memory property bag. In 504, the Java types associated with the Java stream are converted to corresponding ActiveX types (i.e., OLE types) associated with the property bag, desirably at run-time. A type-mapping function, in the form of a look-up table, is desirably used to dynamically convert at run-time a Java type to an OLE type. Thus, the engine desirably parses (i.e., “cracks”) the Java types, and converts them to appropriate OLE types.

[0037] Referring finally to FIG. 6, a flowchart of another method according to a run-time embodiment of the invention is shown. The embodiment of the invention of FIG. 6 may be utilized in conjunction with or in lieu of the embodiment of FIG. 4 or 5; that is, the embodiment of FIG. 6 does not require utilization of FIG. 5 or 6 as well. The method to be performed may be one or more computer programs made up of computer-executable instructions (e.g., an engine program). Describing the method by reference to a flowchart enables one skilled in the art to develop programs including instructions to carry out the methods on a suitable computer (the processor of the computer executing the instructions from computer-readable media such as memory). The one or more computer programs may be stored on a computer-readable medium such as a floppy disk or a compact-disc read-only-memory (CD-ROM). In one embodiment, an engine program converts types (specifically, properties) of an ActiveX control associated with a property bag to corresponding types (specifically, properties) of a Java object associated with a Java stream, and vice-versa, at run-time. The method of FIG. 6 specifically recites the conversion of OLE properties to Java properties, as the latter term is known within the art.

[0038] In 600, a property bag is read, desirably by an engine. That is, an ActiveX control, when writing out to a property bag, has its output intercepted. In 602, a Java stream corresponding to the property bag is dynamically created if necessary (that is, if one does not already exist). In 504, the ActiveX types (specifically, properties) associated with the property bag are converted to corresponding Java types (specifically, properties) associated with the property bag, desirably at run-time. All OLE types (that is, ActiveX types) desirably need to be converted to corresponding Java types in order to persist in the Java stream. The types are dynamically converted desirably at run-time using a type-mapping function, such as a look-up table. Thus, the engine desirably parses (i.e., “cracks”) the OLE types, and converts them to appropriate Java types. A description of a run-time embodiment of the invention has thus been provided.

Conclusion

[0039] Coalescing properties, methods and events has been described. Although specific embodiments have been illustrated and described herein, it will be appreciated by those of ordinary skill in the art that any arrangement which is calculated to achieve the same purpose may be substituted for the specific embodiments shown. This application is intended to cover any adaptations or variations of the present invention. Therefore, it is manifestly intended that this invention be limited only by the following claims and equivalents thereof. 

We claim:
 1. A computerized system comprising: an ActiveX control; a Java object; and, an engine to convert types of the ActiveX control to corresponding types of the Java object.
 2. The computerized system of claim 1, wherein the engine comprises a run-time engine.
 3. The computerized system of claim 2, further comprising a Java stream of properties of the Java object.
 4. The computerized system of claim 2, further comprising a property bag of properties of the ActiveX control.
 5. The computerized system of claim 1, wherein the engine comprises a compile-time engine.
 6. The computerized system of claim 5, wherein the engine converts events of the ActiveX control to corresponding events of the Java object.
 7. The computerized system of claim 5, wherein the engine converts methods of the ActiveX control to corresponding methods of the Java object.
 8. The computerized system of claim 7, wherein the engine converts properties of the ActiveX control to corresponding properties of the Java object.
 9. A computerized method comprising: converting an event of an ActiveX type library to Java; and, converting a method of the ActiveX type library to Java.
 10. The computerized method of claim 9, wherein converting the event of the ActiveX type library to Java comprises converting the event of the ActiveX type library to Java at compile-time.
 11. The computerized method of claim 9, wherein converting the method of the ActiveX type library to Java comprises converting the method of the ActiveX type library to Java at compile-time.
 12. The computerized method of claim 9, further comprising converting a property of the method of the ActiveX type library to Java.
 13. The computerized method of claim 12, wherein converting the property of the method of the ActiveX type library to Java comprises converting the property of the method of the ActiveX library to Java at compile-time.
 14. A computerized method comprising: reading a Java stream; creating a property bag corresponding to the Java stream; and, converting a Java type associated with the Java stream to an ActiveX type associated with the property bag.
 15. The computerized method of claim 14, wherein the method comprises a run-time method.
 16. A computerized method comprising: reading a property bag; creating a Java stream corresponding to the property bag; and, converting an ActiveX type associated with the property bag to a Java type associated with the Java stream.
 17. The computerized method of claim 16, wherein the method comprises a run-time method.
 18. A computer-readable medium having an engine program stored thereon for execution on a computer, the engine program converting types of an ActiveX control to corresponding types of a Java object at compile-time.
 19. The computer-readable medium of claim 18, wherein the engine programs converts methods, events and properties of the ActiveX control to corresponding methods, events and properties of the Java object at compile-time.
 20. A computer-readable medium having an engine program stored thereon for execution on a computer, the engine program converting types of an ActiveX control associated with a property bag to corresponding types of a Java object associated with a Java stream at run-time.
 21. A computer comprising: a processor; a computer-readable medium; and, a computer program executed by the processor from the medium to convert types of an ActiveX control to corresponding types of a Java object.
 22. The computer of claim 21, wherein the computer program converts the types of the ActiveX control to the corresponding types of the Java object at run-time.
 23. The computer of claim 21, wherein the computer program converts the types of the ActiveX control to the corresponding types of the Java object at compile-time.
 24. The computer of claim 21, wherein the engine programs converts methods, events and properties of the ActiveX control to corresponding methods, events and properties of the Java object.
 25. The computer of claim 21, wherein the types of the ActiveX control are associated with a property bag and the types of the Java object are associated with a Java stream. 